package eleventh.StringBuffer类;
//用insert()方法
public class 在任意位置处为StringBuffer添加内容 {
    public static void main(String[] args) throws InterruptedException {
        StringBuffer sb  =new StringBuffer();
        sb.append("一二三四五");
        sb.insert(0,"AAAA");
        System.out.println(sb);
        Thread.sleep(300);
        sb.insert(sb.length(),"扎西德勒");  //在sb.length()长度处增加字符串 即在队尾增加字符串
        System.out.println(sb);

    }
}
/*
D:\WorkSpaces\Java\jdk-21\bin\java.exe "-javaagent:D:\Software\IntelliJ IDEA\IntelliJ IDEA 2023.3.2\lib\idea_rt.jar=52641:D:\Software\IntelliJ IDEA\IntelliJ IDEA 2023.3.2\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath D:\WorkSpaces\JavaDevelopBase_start_329\out\production\JavaDevelopBase_start_329 eleventh.StringBuffer类.在任意位置处为StringBuffer添加内容
AAAA一二三四五
AAAA一二三四五扎西德勒

Process finished with exit code 0

 */